<!DOCTYPE html>
<html>
{include file="head.html"}
<body>
<div class="page">
<div class="fullscreen">
<div class="scroll_content">
<div class="topfixed">
  <div class="t_left"><a href="/index.php?m=user_address"><i class="back"></i></a></div>
  <div class="t_main">收货地址</div>
</div>
<div class="paddingheight"></div>
<div class="comblock">
  <form method="post" action="/index.php?m=user_address&a=save">
    <input type="hidden" name="id" id="id" value="{$data.id}" >
    <input type="hidden" name="referer" value="{$referer}">
    <div class="global_form" style="margin-top:10px;">
      <ul class="list">
        <li><span class="label">学校：</span>{$site.sitename} </li>
        <li><span class="label">区域：</span>
          <select class="txt" name="province_id" id="ajax_province_id">
            <option value="0">请选择</option>
            
                    
    {foreach item=c key=k from=$province_list}
    
                    
            <option value="{$k}" {if $data.province_id eq $k} selected{/if}>{$c}</option>
            
                    
    {/foreach}
  
                  
          </select>
          <select name="city_id" class="txt" id="ajax_city_id">
            <option value="0">请选择</option>
            
                    
    {foreach item=c key=k from=$city_list}
    
                    
            <option value="{$k}"  {if $data.city_id eq $k} selected{/if}>{$c}</option>
            
                    
    {/foreach}
  
                  
          </select>
        </li>
        <li><span class="label">默认：</span> <span class="switch {if $data.isdefault}on{/if}"></span><input type="hidden" name="isdefault" value="{$data.isdefault}"> </li>
        <li><span class="label">寝室号：</span>
          <input type="text" name="sushe" id="sushe"  value="{$data.sushe}" class="inp">
        </li>
        <li><span class="label">姓名：</span>
          <input type="text" name="truename" value="{$data.truename}" class="inp">
        </li>
        <li><span class="label">手机：</span>
          <input type="text" name="telephone" value="{$data.telephone}" class="inp">
        </li>
        <li>
        	<span class="label">详细地址</span>
            <input type="text" name="address" value="{$data.address}" placeholder="" class="inp">
            <p style="text-align:center;">(如：福建省福鼎市太姥山1号,全国购物时使用，校园购物可不填)</p>
        </li>
        <li><span class="label"></span>
          <button type="submit" class="btn">保存</button>
        </li>
      </ul>
    </div>
  </form>
</div>
<script>
$(".global_form .switch").click(function(e) {
    if($(this).hasClass("on")){
		$(this).removeClass("on");
		}else
		{
			$(this).addClass("on");
		}
});
$("#sushe").on("keyup",function(){
	if($(this).val().match(/[^\d]/)){
		skyToast('寝室只能为数字');
		$(this).val("");
	}
})
</script> 
<script src="{$skins}js/user_address.js"></script>
</body>
</html>